package student.aistar.util;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

public class JdbcTemplate {
    public static int  execute(PreparedStatementCallBack preparedStatementCallBack) throws SQLException {
        Connection connection = null;
        connection = JdbcUtil.getConnection();
        PreparedStatement preparedStatement = preparedStatementCallBack.execute(connection);

        int flag = preparedStatement.executeUpdate();
        return flag;
    }
}
